#ifndef CCONFIGERINSTANCE_H
#define CCONFIGERINSTANCE_H

#include "common/cconfigurer.h"
#include "Plugins/dirHelper/cDirHelper.h"

#define INI_FILE_NAME "config.ini"

typedef struct _configerInstance
{
    _configerInstance()
    {
        using namespace libtool_sdk;

        std::string strFilePath(INI_FILE_NAME);    

        printf("load ini file %s\n", strFilePath.c_str());

		if (!Helper::Tool_checkFileOrDirExsit(strFilePath.c_str()))
        {
            cConfigurer::get_instance().createIniFile(strFilePath.c_str());
            cConfigurer::get_instance().loadIniFile(strFilePath.c_str());

            cConfigurer::get_instance().set_section_value("camera", "ip", "127.0.0.1");

            cConfigurer::get_instance().set_section_value("Log", "Enable", "1" );
			cConfigurer::get_instance().set_section_value("Log", "rootPath", "");
        }
        else
        {
            cConfigurer::get_instance().loadIniFile(strFilePath.c_str());
        }
    }

    ~_configerInstance()
    {

    }

}configerInstance;

#endif // CCONFIGERINSTANCE_H
